package com.java.controller;

import com.java.pojo.Bank;
import com.java.pojo.Bank2;
import com.java.service.Bank2Service;
import com.java.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.List;

@Controller
@RequestMapping("/bank")
public class Bank_Bank2Controller {
    @Autowired
    private Bank2Service bank2Service;

    @Autowired
    private BankService bankService;

    @RequestMapping(value = "/loginBank",produces = "text/html;charset=UTF-8")
    public String l(Model model){
        List<Bank> bankList = bankService.getBankList();
        List<Bank2> bank2List = bank2Service.getBank2List();
        Double bankMoney = bankService.getCountMoney();
        Double bank2Money = bank2Service.getCountMoney();
        model.addAttribute("b1",bankList);
        model.addAttribute("b2",bank2List);
        model.addAttribute("m1Money",bankMoney);
        model.addAttribute("m2Money",bank2Money);
        return "bank/findAllByBank";
    }
}
